﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        private Color[] kleur = { Color.Green, Color.Gold };
        private int i = 0;
        public Form1()
        {
            InitializeComponent();
            this.BackColor = kleur[i];
        }

        private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {
            i = i == 0 ? 1 : 0;
            this.BackColor = kleur[i];
            double percent = Math.Max(0.2, (double)NumPerc.Value / 10.0);
            onzichtbaar.Text = percent.ToString();
            this.Opacity = percent;
        }
    }
}
